package controllers;

import java.util.List;
import models.Provider;
import play.mvc.Controller;

public class Application extends Controller {

    public static void index() {
        /* You can uncomment following lines to test Provider creation with
         password generation*/
        //Provider p =new Provider("Петя","Украина");
        //p.save();
        render();
    }

    
    public static void registration(String name, String country) {
        Provider provider = new Provider(name, country);
        renderJSON(provider);
    }

    public static void getProviders() {
        List<Provider> providers = Provider.findAll();
        renderJSON(providers);
    }
}